﻿/*nav*/
function menuPro(nav){	
	$('li:has(> .levelChild)',nav).addClass('parent');
	$("li.parent",nav).hover(function(){
		$(this).addClass('on'); $('> a', this).addClass('hover'); 
	}, function(){
		$(this).removeClass('on'); $('> a', this).removeClass('hover'); 
	});
}
/*tab*/
function tab(nav,content,on,type)
{
	$(nav).children().bind(type,(function(){
		var $tab=$(this);
		var tab_index=$tab.prevAll().length;
		var $content = $(content).children();
		$(nav).children().removeClass(on);
		$tab.addClass(on);
		$content.hide();
		$content.eq(tab_index).show();
	}));
}


/*action start*/
$(function(){
  $(".exchange").click(function(){ alert("正在建设中。")});
  menuPro(".category");
   tab(".home-info .hinfo-tabs ul",".home-info .hinfo-list","on","mouseover");
   tab(".home-product01 .tabs-title",".home-product01 .product-list","on","mouseover");
   tab(".home-product02 .tabs-title",".home-product02 .product-list","on","mouseover");
   tab(".hot-ranking .tabs-title",".hot-ranking .hranking-list","on","mouseover");
   tab(".product-info .tabs-blue03",".product-info .product-attributes","on","mouseover")
   tab(".registerBg .registerTabs",".registerBg .registerConBg","on","mouseover");
    tab(".shoppingLegCon .shoppingTab",".shoppingLegCon .shoppingCartContent","on","mouseover");
   $(".col-list").click(function(){$(this).children("ul").show(); $(this).siblings().children("ul").hide();});
   $(".downmune").toggle(function(){$(this).addClass("onit"); $(".category").show();},function(){$(this).removeClass("onit"); $(".category").hide();});
   $(".header-city").hover(function(){$(".header-city p a").addClass("on");$(".other-citys").show();},function(){$(".header-city p a").removeClass("on");$(".other-citys").hide();})
})